//
// Created by pengtg on 2020/3/5.
//

#ifndef ANDROIDVIDEOPLAYER_IPLAYERPROXY_H
#define ANDROIDVIDEOPLAYER_IPLAYERPROXY_H


#include "IPlayer.h"
#include <mutex>

class IPlayerProxy : public IPlayer
{
public:
    static IPlayerProxy *Get()
    {
        static IPlayerProxy px;
        return &px;
    }
    void Init(void *vm = 0);

    virtual bool Open(const char *path);
    virtual void Close();
    virtual bool Start();
    virtual void InitView(void *win);
    //获取当前的播放进度 0.0-1.0
    virtual double PlayPos();
    virtual bool Seek(double pos);
    virtual void SetPause(bool isP);
    virtual bool IsPause();

protected:
    IPlayerProxy(){}
    IPlayer *player = 0;
    std::mutex mux;
};


#endif //ANDROIDVIDEOPLAYER_IPLAYERPROXY_H
